﻿using FluentNHibernate.Mapping;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace mscook.core.domain
{
    public class HotelMap : ClassMap<Hotel>
    {
        public HotelMap()
        {
            Id(o => o.Id);
            Map(o => o.CreateTime);
            Map(o => o.IsDelete);
            Map(o => o.Version);
            Map(o => o.EntityIndex);
            Map(o => o.ImageName);
            Map(o => o.Name);
            Map(o => o.Address);
            Map(o => o.Summary).Length(500);
            Map(o => o.Editor);
            Map(o => o.PhoneNum);
            Map(o => o.IsPartner).Default("0");
            Map(o => o.IsShowOnBottom).Default("0");
            Map(o => o.BottomImagePath);
            Map(o => o.Description).CustomType("StringClob").CustomSqlType("nvarchar(max)");
            HasMany<CookBook>(o => o.CookBooks).KeyColumn("HotelId");
        }

    }
}
